#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::Widget(int fd,QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_play_clicked()
{
    mkfifo("fifo",0666);
    int fd = open("fifo", O_WRONLY);
    char buff[128] = "loadfile ../mp3player/song/简单爱.mp3\n";
    write(fd,buff,128);
}

void Widget::on_pause_clicked()
{
    mkfifo("fifo",0666);
    int fd = open("fifo", O_WRONLY);
    char buff[128] = "pause\n";
    write(fd,buff,128);
}
